<?php
class TagController extends Controller
{
    public $models = 'Tag';
    //因为index函数同样是Index的构造函数。。。
    public function index()
    {
        $this->render(array('title' => _('标签'), 'tags' => $this->Tag->getAll()), 'index');
    }

    public function name()
    {
        global $PARAM;
        $paramNames = array_keys($PARAM);
        if (!isset($paramNames[0]))
            redirect('index');
        redirect('index', 'index', array('tag' => htmlspecialchars($paramNames[0])));
    }
}
?>
